<div class="hero-unit" style="padding:20px 20px 0 20px ">
  <%= form_for(@exam) do |f| %>
      <% if @exam.errors.any? %>
          <div id="error_explanation">
            <h2>在保存时发生<%= @exam.errors.count %>个错误:</h2>
            <ul>
              <% @exam.errors.full_messages.each do |msg| %>
                  <li><%= msg %></li>
              <% end %>
            </ul>
          </div>
      <% end %>

      <div class="clearfix">
        <%= f.label :title %>
        <div class="input">
          <%= f.text_field :title %>
          <span class="help-block">不可为空,且唯一</span>
        </div>
      </div>
      <div class="clearfix">
        <%= f.label :description %>
        <div class="input">
          <%= f.text_field :description %>
          <span class="help-block">可为空</span>
        </div>
      </div>
      <div class="clearfix">
        <%= f.label :ctime %>
        <div class="input">
          <%= f.datetime_select :ctime, {:use_month_numbers =>false}, :class=>"mini" %>
          <span class="help-block">时间格式:[年 月 日- 小时:分钟]</span>
        </div>
      </div>
      <% if !@groups.nil? %>
          <div class="clearfix">
            <%= f.label "应到分组" %>
            <div class="input">
              <% @groups.each do |g| %>
                  <label style="width: 100px;text-align: left;">
                    <input type="checkbox" name="<%= g %>" checked="checked"/>
                    <span>  <%= g %></span>
                  </label>
              <% end %>
              <span class="help-block" style="width: 500px;"><strong>选择后将无法更改</strong></span>
            </div>
          </div>
      <% end %>
      <div class="actions">
        <%= f.submit :class=>"btn primary" %>
        <button type="reset" class="btn">取消</button>
      </div>
  <% end %>
</div>